<!-- 商铺信息 -->
<template>
	<view class="container">
		<view class="content">
			<view class="header">
				<text class="name">鱼米之乡农资站</text>
				<text class="label">服务评价：</text>
				<text class="star-icon iconfont active">&#xe604;</text>
				<text class="star-icon iconfont active">&#xe604;</text>
				<text class="star-icon iconfont active">&#xe604;</text>
				<text class="star-icon iconfont active">&#xe604;</text>
				<text class="star-icon iconfont">&#xe604;</text>
			</view>
			<view class="body">
				<text class="label">本店有惊喜，新品推出、满减优惠</text>
			</view>
			<view class="footer">
				<view class="tag-group">
					<text class="tag border-1px">满50减10</text>
					<text class="tag border-1px">满99减20</text>
				</view>
				<view class="coupon-group">
					<text class="coupon">领5元券</text>
				</view>
				<view class="contact">
					<button class="distance" @click="handleOpenLocation()">
						<text class="iconfont">&#xe610;</text> 950m
					</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	const handleOpenLocation = () => {
		uni.openLocation({
			latitude: 23.281403,
			longitude: 113.671278,
			name: '鱼米之乡农资站',
			address: '朱村街道凤岗科汇三街15号'
		});
	}
</script>

<style lang="scss" scoped>
	.container {
		position: relative;
		z-index: 1;
		padding: 0 25rpx;
		margin-top: -54rpx;

		.content {
			height: 174rpx;
			padding: 22rpx 18rpx 0 28rpx;
			border-radius: 20rpx;
			background: linear-gradient(to bottom, #FFECEC, #ffffff 40%);
			box-sizing: border-box;
		}
	}

	.header {
		display: flex;
		align-items: flex-start;

		.name {
			flex-grow: 1;
			width: 0;
			font-weight: bold;
			font-size: 30rpx;
			color: #222222;
			line-height: 1.5;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
			padding-right: 10rpx;
		}

		.label {
			flex-shrink: 0;
			font-weight: 500;
			font-size: 22rpx;
			color: #222222;
			line-height: 30rpx;
		}

		.star-icon {
			flex-shrink: 0;
			font-size: 20rpx;
			color: #CCCCCC;

			&+.star-icon {
				margin-left: 6rpx;
			}

			&.active {
				color: #FE3333;
			}
		}
	}

	.body {
		display: flex;
		margin-top: 6rpx;

		.label {
			font-weight: 500;
			font-size: 22rpx;
			color: #222222;
			line-height: 1.5;
		}
	}

	.footer {
		display: flex;
		align-items: center;
		margin-top: 12rpx;

		.tag-group {
			flex-shrink: 0;
			display: flex;

			.tag {
				height: 30rpx;
				font-weight: 500;
				font-size: 20rpx;
				color: #FE3333;
				line-height: 30rpx;
				background: #FFEFF4;
				padding: 0 8rpx;

				&::after {
					border-color: #FE3A3A;
					border-radius: 16rpx;
				}

				&+.tag {
					margin-left: 10rpx;
				}
			}
		}

		.coupon-group {
			flex-grow: 1;
			display: flex;
			margin-left: 10rpx;

			.coupon {
				display: flex;
				align-items: center;
				height: 34rpx;
				font-weight: 500;
				font-size: 20rpx;
				color: #FE3333;
				line-height: 34px;
				background: #FFEFF4;
				border-radius: 8rpx;
				padding-right: 6rpx;
				overflow: hidden;

				&::before {
					content: '券';
					width: 30rpx;
					height: 34rpx;
					font-weight: 500;
					font-size: 20rpx;
					color: #FFFFFF;
					line-height: 34rpx;
					text-align: center;
					background: #FE3333;
					margin-right: 6rpx;
				}
			}
		}

		.contact {
			flex-shrink: 0;
			display: flex;
			align-items: center;

			.phone-icon {
				font-size: 32rpx;
				color: #666666;
			}

			.distance {
				font-weight: 500;
				font-size: 22rpx;
				color: #666666;
				line-height: 1.5;
				padding-left: 17rpx;
				margin-left: 15rpx;
				background-color: transparent;

				.iconfont {
					font-size: 26rpx;
				}
			}
		}
	}
</style>